(function(YuXi){
	var ALLSearch={};
	//信息管理-已提交信息
	ALLSearch.special=function(query){
		var information={};
		information.key = $("#profile").val(); //简介
		if($("#profile").val()=="请输入简介关键字")
		{
			information.key="";
		}
		//--------10.7xiugai------------------------------
		
		try{
			information.salfPort=$("#fenk").select2('val').join(",")+",";

			
		}
		catch(e){
			information.salfPort="null";
		}
		
	//----------------------------------------------

		
		information.structure=$(".reDepartment option:selected").val();//部门
		var inputNameFlag=$("#requestName").val();//参与人
				if(inputNameFlag=="请输入参与人/录入人姓名或警号")
		{
			information.intputName="";
			delete information.intputNumber;
		}
		else
		{ 
			var flag=/^[(-?\d+\.\d+)|(-?\d+)|(-?\.\d+)]+$/.test(inputNameFlag + '');
			
			if(!flag)
			{
				information.intputName=inputNameFlag;
				
				delete information.intputNumber;
			}
			else 
			{
				
				delete information.intputName;
				information.intputNumber=inputNameFlag;

			}
		}
		
		var curFlowText = $(".reSearchFlow option:selected").val();
		curFlowText == null ? "" : information.curFLow = curFlowText; //当前状态
		
		try{
			information.informationSource =$(".reSearchSource").select2('val').join(",");
			
		}
		catch(e){
			information.informationSource="null";
		}
		information.informationLv = $(".reSearchpes option:selected").val() ;//分级
		information.informationSort=$(".reSearchsort option:selected").val();//分类
		

		var array = [];
		var starTime=$("#starTime").val();
		var endTime=$("#endTime").val();
		
		array=YuXi.timestamp.get(starTime,endTime,null);
		if(array[0]!=null)
		information.startTimestamp = array[0];
		if(array[1]!=null)
		information.endTimestamp = array[1];
	
		information.currentPage=1;
		$.extend(information,query);
		return information;

		

	}
	//最多的查询条件
	ALLSearch.top=function(query){
			var information={};
	
		var starTime="";
		var endTime="";
		var chooseFlow={};

		//------------初审---------------------------------10.8
		starTime=$("#firstStartTime").val();//提交起始时间
		endTime=$("#firstEndTime").val();//提交结束时间
		
		array = YuXi.timestamp.get(starTime,endTime, null);
		if(array[0]!=null)
		chooseFlow.firstStartTime = array[0];
		if(array[1]!=null)
		chooseFlow.firstEndTime = array[1];
		//------------复核flow
		starTime=$("#reCheckStartTime").val();//提交起始时间
		endTime=$("#reCheckEndTime").val();//提交结束时间
		array = YuXi.timestamp.get(starTime,endTime, null);
		if(array[0]!=null)
		chooseFlow.recheckStartTime = array[0];
		if(array[1]!=null)
		chooseFlow.recheckEndTime = array[1];
	//------------审核flow
		starTime=$("#checkStartTime").val();//提交起始时间
		endTime=$("#checkEndTime").val();//提交结束时间
		array = YuXi.timestamp.get(starTime,endTime, null);
		if(array[0]!=null)
		chooseFlow.checkStarTime = array[0];
		if(array[1]!=null)
		chooseFlow.checkEndTime = array[1];
	
		starTime=$("#researchStartTime").val();//提交起始时间
		endTime=$("#researchEndTime").val();//提交结束时间
		array = YuXi.timestamp.get(starTime,endTime, null);
		if(array[0]!=null)
		chooseFlow.researchStartTime = array[0];
		if(array[1]!=null)
		chooseFlow.researchEndTime = array[1];
	
		information=chooseFlow;

		

		information.key = $("#profile").val(); //简介
		if($("#profile").val()=="请输入简介关键字")
		{
			information.key="";
		}
		information.informationLv = $(".reSearchpes option:selected").val() //分级
		information.informationSort = $(".reSearchsort option:selected").val() //分类
	//******************************************************12.10搜索************************04
		try{
			information.informationSource =$(".reSearchSource").select2('val').join(",");
			
		}
		catch(e){
			information.informationSource="null";
		}
		//******************************************************12.10************************04
		//来源渠道

		var curFlowText = $(".reSearchFlow option:selected").val();
		curFlowText == null ? "" : information.curFLow = curFlowText; //当前流程
		//----------------------------------------
		var fenkouID=$(".rePort option:selected").val()+",";//分口
		fenkouID+=YuXi.recursionSource.get(fenkouID,"1");
		var arrayunqiue=[];
		arrayunqiue=YuXi.recursionSource.unique(fenkouID.split(","));
		fenkouID=arrayunqiue.join(",");
		information.salfPort=fenkouID; 
		//---------------------------------------
		information.informationJudge=$(".repingjia option:selected").val();//评价
		var inputNameFlag=$("#requestName").val();//参与人
		information.intputNumber="";
		if(inputNameFlag=="请输入参与人/录入人姓名或警号")
		{
			information.intputName="";
			delete information.intputNumber;
		}
		else
		{ 
			var flag=/^[(-?\d+\.\d+)|(-?\d+)|(-?\.\d+)]+$/.test(inputNameFlag + '');
			
			if(!flag)
			{
				information.intputName=inputNameFlag;
				
				delete information.intputNumber;
			}
			else 
			{
				
				delete information.intputName;
				information.intputNumber=inputNameFlag;

			}
		}
		var finishNameFlag=$("#refinishName").val();//完成人
		if(finishNameFlag=="请输入派遣人姓名或警号" || finishNameFlag=="请输入完成人姓名或警号")
		{
			information.finisPerson="";
			delete information.finisPersonNum;
		}
		else
		{ 
			var flag=/^[(-?\d+\.\d+)|(-?\d+)|(-?\.\d+)]+$/.test(finishNameFlag + '');
			
			if(!flag)
			{
				information.finisPerson=finishNameFlag;
				delete information.finisPersonNum;
			}
			else
			{
				delete information.finisPerson;
				information.finisPersonNum=finishNameFlag;
			}
		}
		information.structure=$(".reDepartment option:selected").val();//部门
		information.qualityId=$(".reinputDian option:selected").val();//录入点评
		information.completeId=$(".refinishDian option:selected").val();//完成点评
		
		

			
		starTime=$("#starTime").val();//建立起始时间
		endTime=$("#endTime").val();//建立结束时间
		array = YuXi.timestamp.get(starTime,endTime, null);
		if(array[0]!=null)
		information.startTimestamp = array[0];
		if(array[1]!=null)
		information.endTimestamp = array[1];
		
		information.currentPage=1;

		//查询数据传送给后台
		information.structValue=$(".reDepartment").attr("data-value");
		information.structId=$(".reDepartment").attr("data-id");
		
		$.extend(information,query);
		
		return information;
	}
	ALLSearch.base=function(query){
		var information={};
	
		var starTime="";
		var endTime="";
		

		starTime=$("#submitstarTime").val();//提交起始时间
		endTime=$("#submitendTime").val();//提交结束时间
		
		if (typeof(starTime) != "undefined") {
			var attrtask=$("#submitstarTime").attr("placeholder");
			array = YuXi.timestamp.get(starTime,endTime, null);
			if(attrtask=="请选择任务起始时间")
			{
				if(array[0]!=null)
					information.startFinishTime = array[0];
				if(array[1]!=null)
					information.endFinishTime = array[1];
		
			}
			else 
			{
				if(array[0]!=null )
					information.startCommitTime = array[0];
				if(array[1]!=null)
					information.endCommitTime = array[1];
			}


		}
		
		
		
		information.informationJudge=$(".repingjia option:selected").val();//评价
		information.isFinish=$(".isFinsih option:selected").val();//是否完成
		information.key = $("#profile").val(); //简介
		if($("#profile").val()=="请输入简介关键字")
		{
			information.key="";
		}
		information.informationLv = $(".reSearchpes option:selected").val() //分级
		information.informationSort = $(".reSearchsort option:selected").val() //分类
	//******************************************************12.10搜索************************04
		try{
			information.informationSource =$(".reSearchSource").select2('val').join(",");
			
		}
		catch(e){
			information.informationSource="null";
		}
		//******************************************************12.10************************04
		//来源渠道

		var curFlowText = $(".reSearchFlow option:selected").val();
		curFlowText == null ? "" : information.curFLow = curFlowText; //当前流程
		//----------------------------------------
		var fenkouID=$(".rePort option:selected").val()+",";//分口
		fenkouID+=YuXi.recursionSource.get(fenkouID,"1");
		var arrayunqiue=[];
		arrayunqiue=YuXi.recursionSource.unique(fenkouID.split(","));
		fenkouID=arrayunqiue.join(",");
		information.salfPort=fenkouID; 
		//---------------------------------------
		information.informationJudge=$(".repingjia option:selected").val();//评价
		var inputNameFlag=$("#requestName").val();//参与人
		information.intputNumber="";
		if(inputNameFlag=="请输入参与人/录入人姓名或警号")
		{
			information.intputName="";
			delete information.intputNumber;
		}
		else
		{ 
			var flag=/^[(-?\d+\.\d+)|(-?\d+)|(-?\.\d+)]+$/.test(inputNameFlag + '');
			
			if(!flag)
			{
				information.intputName=inputNameFlag;
				
				delete information.intputNumber;
			}
			else 
			{
				
				delete information.intputName;
				information.intputNumber=inputNameFlag;

			}
		}
		var finishNameFlag=$("#refinishName").val();//完成人
		if(finishNameFlag=="请输入派遣人姓名或警号" || finishNameFlag=="请输入完成人姓名或警号")
		{
			information.finisPerson="";
			delete information.finisPersonNum;
		}
		else
		{ 
			var flag=/^[(-?\d+\.\d+)|(-?\d+)|(-?\.\d+)]+$/.test(finishNameFlag + '');
			
			if(!flag)
			{
				information.finisPerson=finishNameFlag;
				delete information.finisPersonNum;
			}
			else
			{
				delete information.finisPerson;
				information.finisPersonNum=finishNameFlag;
			}
		}
		information.structure=$(".reDepartment option:selected").val();//部门
		information.qualityId=$(".reinputDian option:selected").val();//录入点评
		information.completeId=$(".refinishDian option:selected").val();//完成点评
		
		starTime=$("#starTime").val();
		endTime=$("#endTime").val();
		array=YuXi.timestamp.get(starTime,endTime,null);
		var attr=$("#starTime").attr("placeholder");
		if(attr=="请选择派遣起始时间")
		{
	
			if(array[0]!=null)
				information.startFinishTime = array[0];
			if(array[1]!=null)
				information.endFinishTime = array[1];
		}
		else
		{
		
			if(array[0]!=null)
				information.startTimestamp = array[0];
			if(array[1]!=null)
				information.endTimestamp = array[1];

		}
		

		information.currentPage=1;

		//查询数据传送给后台
		information.structValue=$(".reDepartment").attr("data-value");
		information.structId=$(".reDepartment").attr("data-id");
		
		$.extend(information,query);
		
		return information;

	}

	YuXi.ALLSearch=ALLSearch;
})(YuXi)
